/* $Id: ServletAlbum.java,v 1.2 1999/03/17 02:21:36 duncan Exp $
 *
 */

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/*
import java.util.ResourceBundle;
import java.io.PrintWriter;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.servlet.http.HttpServlet;
 */

/**
 * A Servlet to help view jpg images
 *
 * @author James Chy
 */

public class OversizeDisp extends PhotoServlet {

    /*
	String title, imgStrPath, thbStrPath;
    int newThumbs, updatedThumbs;
    double maxSize=64.0;
    ResourceBundle rb;
    boolean showQuery;
    PrintWriter out;
    String connection;
    String imgover;
    */

    static final long serialVersionUID = 0;
    
    public void init(ServletConfig config) throws ServletException
    {
        super.init(config);
/*
        rb = ResourceBundle.getBundle("LocalStrings");
        title = rb.getString("servletAlbum.title");
        showQuery = rb.getString("servletAlbum.showQuery").equals("yes");
        connection = rb.getString("servletAlbum.connection");
        imgover = rb.getString("servletAlbum.imgover");
*/
    }
        
/*
    public ResultSet executeQuery(String query)
    {
        ResultSet rs=null;
        try
        {
            Class.forName("org.gjt.mm.mysql.Driver").newInstance();
            java.sql.Connection conn;
            conn = DriverManager.getConnection(connection);
            Statement stmt;

            stmt=conn.createStatement();
                  
            rs = stmt.executeQuery(query);

        }
        catch(ClassNotFoundException cnfe)
        {
            out.println("Class Not Found Exception "+cnfe.toString());
        }
        
        catch(InstantiationException ie)
        {
            out.println("Instantiation Exception "+ie.toString());
        }        
        catch(IllegalAccessException iae)
        {
            out.println("Illegal Access Exception "+iae.toString());
        }
        catch(SQLException sqle)
        {
            out.println("SQL Exception "+sqle.toString());
        }

        return rs;
    }
*/
    public void doPost(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException
    {
        response.setContentType("text/html");
        out = response.getWriter();

        String image=request.getParameter("image");        

        out.println("<html>");
        out.println("<body bgcolor=\"white\">");
        out.println("<head>");

        out.println("<title>" + title + "</title>");  
        out.println("</head>");
        out.println("<body>");

        out.print("<img src=\"" + imgover + "/" + image + "\">");
        out.println("<BR>");

        out.println("</body>");
        out.println("</html>");
    }
}



